﻿
Public Class function_call4
    Inherits function_call2

    Public Const selector As Char = character.rightAngleBracket
    Public Const selector2 As Char = character.leftAngleBracket

    Protected Friend Shared Shadows Function _isMeaningfulMark(ByVal c As Char) As Boolean
        Return isSelector(c) OrElse isSelector2(c)
    End Function

    Private Shared Function isSelector(ByVal c As Char) As Boolean
        Return c = selector
    End Function

    Private Shared Function isSelector2(ByVal c As Char) As Boolean
        Return c = selector2
    End Function

    Private Sub New(ByVal name As String, ByVal ps As parameters_list4)
        MyBase.New(name, ps)
    End Sub

    Private Shared Function parseImpl(ByVal input As String, ByRef index As Int64, _
                                      ByRef output As function_call4) As Boolean
        Dim pl As parameters_list4 = Nothing
        pl = New parameters_list4()
        If pl.parseIndividual(input, index) AndAlso _
           (token(input, index, Nothing, AddressOf isSelector, AddressOf [false]) OrElse _
            token(input, index, Nothing, AddressOf isSelector2, AddressOf [false])) Then
            Dim name As String = Nothing
            If function_name_defination.parse(input, index, name) AndAlso _
               token(input, index, Nothing, AddressOf isParameterStart, AddressOf [false]) AndAlso _
               pl.parseList(input, index) AndAlso _
               token(input, index, Nothing, AddressOf isParameterEnd, AddressOf [false]) Then
                output = New function_call4(name, pl)
                Return True
            End If
        End If
        Return False
    End Function

    Public Shared Shadows Function parse(ByVal input As String, ByRef index As Int64, _
                                         ByRef output As function_call4) As Boolean
        Return parsebase(input, index, output, AddressOf parseImpl)
    End Function
End Class
